package test3_28.demo02;

import java.util.Arrays;
import java.util.Random;

public class Homework16_4_ArrayList {

    private int[] arr = new int[10];

    public Homework16_4_ArrayList(int[] arr) {
        this.arr = arr;
    }

    public void randomArr(){
        Random random = new Random();
        for (int i = 0; i < arr.length; i++) {
            int index = random.nextInt(10);
            int tmp;
            tmp = arr[i];
            arr[i] = arr[index];
            arr[index] = tmp;
        }

        System.out.println(Arrays.toString(arr));

    }


    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6,7,8,9,10};
        Homework16_4_ArrayList arrayList = new Homework16_4_ArrayList(arr);
        arrayList.randomArr();
    }

}
